package com.cium.aqie.highOrderFunction

/**
 * @Function:
 * @Author: aqie
 * @Date: 2019/9/1 17:16
 */
class Hello{
    fun world(){
        println("Hello World.")
    }
}
class PdfPrinter{
    fun println(any: Any){
        kotlin.io.println(any)
    }
}

fun main() {
    // 1.引用类成员方法
    val helloWorld = Hello::world
    val arrayOfString: Array<String> = arrayOf("Hello","World","","aqie")
    val list:List<String> = arrayOfString.filter(predicate = String::isNotEmpty)
    // 2.包级函数
    arrayOfString.forEach(::println)
    list.forEach(::println)

    // 3.需要实例，调用者引用方法，带有Receiver的引用
    val pdfPrinter = PdfPrinter()
    list.forEach(pdfPrinter::println)

}